package Dao.impl;

import Dao.studentGroupDao;
import domain.studentgroup;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import uilts.C3P0utils;

import java.sql.SQLException;
import java.util.List;

public class studentGroupDaoImpl implements studentGroupDao {
    C3P0utils c3P0utils=new C3P0utils();
    @Override
    public  List<studentgroup> findAll(String sql) throws SQLException {
        /*查询出所有学生分组信息*/
        QueryRunner queryRunner = new QueryRunner(c3P0utils.getDataSource());
          return    queryRunner.query(sql, new BeanListHandler<studentgroup>(studentgroup.class));
    }
}
